package com.infore.siteManagement.OutSide.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.OutSide.Service.ISparePartService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "备品备件信息调用接口", tags = { "备品备件信息调用接口" })
@RestController
@RequestMapping("/sparePart")
public class SparePartController {

	@Autowired
	private ISparePartService iSparePartService;

	@ApiOperation(value = "查询用户下合同站点信息接口")
	@ApiImplicitParams({
			@ApiImplicitParam(value = "userIds", name = "userIds", dataType = "String", required = false, paramType = "query") })
	@GetMapping(value = "/queryContStatByUser")
	public ResultEntity queryContStatByUser(String userIds) {
		return iSparePartService.queryContStatByUser(userIds);
	}

	@ApiOperation(value = "查询站点关联的仪器合同信息")
	@ResponseBody
	@PostMapping(value = "/queryStationContrEquip")
	public ResultEntity queryStationContrEquip(
			@RequestParam(value = "stationIds", required = true) List<String> stationIds) {
		return iSparePartService.queryStationContrEquip(stationIds);
	}
}
